# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=xdg-utils-cxx
pkgver=1.0.1
pkgrel=2
pkgdesc='Implementation of the FreeDesktop specifications to be used in C++ projects'
arch=(x86_64)
url='https://github.com/azubieta/xdg-utils-cxx'
license=(MIT)
depends=()
makedepends=(cmake)
source=(https://github.com/azubieta/xdg-utils-cxx/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('2cdeda2385faa0ce496a5b276f5145f2dfb3f67ee77789cf8f57752abc83e69b')

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_CXX_FLAGS="${CXXFLAGS} -fPIC -ffat-lto-objects"
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build

  install -Dm644 $pkgname-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
